<div class="row">
    <div class="col-md-8">
        <div>
            <div class="grid-header clearfix">
                <span class="fl f14 lh30 text-indent">组织部门列表：</span>
                <div class="tab-bottom-line"></div>
            </div>

            <div class="mt15">
                <div id="org-tree"></div>
            </div>
        </div>
    </div>

    <div class="col-md-16">
        <div class="grid-header clearfix">
            <span class="fl f14 lh30 text-indent">用户列表：</span>
            <div class="fr"
                 ng-show="userAuthList.indexOf('1210') !== -1 || userAuthList.indexOf('0030') !== -1">
                <input type="text" class="input-text fl mr5 w200"
                       placeholder="用户名称"
                       ng-model="keyword"
                       ng-enter="search()">
                <span class="fl mr5">
                    <a class="btn" ng-click="search()">搜索</a>
                </span>
            </div>
            <div class="tab-bottom-line"></div>
        </div>
        <div class="mt50 text-center" ng-hide="userList">对不起，没有找到你想要的结果</div>
        <div class="table-wrap mt15" ng-show="userList">
            <table class="valign-t" width="100%">
                <tbody>
                <tr class="thead ta-l border-bottom">
                    <th width="40">序号</th>
                    <th width="60">用户名</th>
                    <th width="120">所属公司</th>
                    <th width="120">兼职公司</th>
                    <th width="80">用户角色</th>
                    <th width="100">操作</th>
                </tr>
                <tr class="border-bottom"
                    ng-repeat="item in userList">
                    <td>{{ $index + 1 + ( pageIndex -1 ) * pageSize }}</td>
                    <td>{{ item.UserName }}</td>
                    <td>{{ item.BUName }}</td>
                    <td>
                        <span ng-repeat="coms in item.partTimeBUList">
                            <i ng-if="$index != 0">,</i>
                            {{ coms.BUName }}
                        </span>
                        <i class="icon-op icon-op-edit"
                           ng-show="userAuthList.indexOf('1211') !== -1 || userAuthList.indexOf('0031') !== -1"
                           ui-dialog="设定兼职公司"
                           ui-dialog-init="setRelate($dialog, $dialogScope, item)"
                           ui-dialog-ok="saveRelate($dialog, $dialogScope, item, index)"
                           template="setRelateTemplateUrl"></i>
                    </td>
                    <td>
                        <span ng-repeat="roles in item.roleList">
                            <i ng-if="$index != 0">,</i>
                            {{ roles.role_name }}
                        </span>
                        <i class="icon-op icon-op-edit"
                           ng-show="userAuthList.indexOf('1211') !== -1 || userAuthList.indexOf('0031') !== -1"
                           ui-dialog="用户关联角色"
                           ui-dialog-init="setRelate($dialog, $dialogScope, item)"
                           ui-dialog-ok="saveRelate($dialog, $dialogScope, item, index)"
                           template="setRelateTemplateUrl"></i>
                    </td>
                    <td>
                        <div ng-show="userAuthList.indexOf('1211') !== -1 || userAuthList.indexOf('0031') !== -1">
                            <a class="vi-color"
                               ng-show="item.isAreaCharge == 0"
                               ng-click="setPrincipal(item)">
                                设定为区域负责人
                            </a>
                            <a class="vi-color"
                               ng-show="item.isAreaCharge == 1"
                               ng-click="setPrincipal(item)">
                                取消区域负责人身份
                            </a>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <div ui-pagination
             page-index="pageIndex"
             page-size="pageSize"
             total="pageTotal"
             changed="pageChange( $pageIndex, $pageSize )">
        </div>
    </div>
</div>